package com.micangcaihang.micang.mvp.login.contract;


import com.micangcaihang.common.base.mvp.BaseModel;
import com.micangcaihang.common.base.mvp.BasePresenter;
import com.micangcaihang.common.base.mvp.IBaseView;
import com.micangcaihang.common.http.ApiResult;
import com.micangcaihang.micang.entity.UserEntity;

import io.reactivex.Observable;

/**
 * <pre>
 *     author : Fandy
 *     e-mail : fandayongfly@gmail.com
 *     time   : 2017/7/30
 *     update : 2017/7/30
 *     desc   : 登录
 *     version: 1.0
 * </pre>
 */

public interface LoginContract {
    interface View extends IBaseView {
        /**
         * 返回登录结果用户数据
         *
         * @param userEntity
         */
        void returnLoginData(UserEntity userEntity);
    }

    interface Model extends BaseModel {
        /**
         * 加载用户数据
         *
         * @return
         */
        Observable<ApiResult<UserEntity>> getUserData(String usermane, String password);
    }

    abstract class Presenter extends BasePresenter<View> {
        public abstract void httpLogin(String username, String password);
    }
}
